<script lang="ts" setup>
import navigateTo, {getCurrentPage} from '@/utils/navigator'

defineProps<{
    title: string
    color: string
    statusBarBg?: string
}>()

function onClickLeft() {
    const {videoInfo} = useVideo()
    const id = videoInfo?.id || getCurrentPage().options?.id
    navigateTo(`/pages/detail/index?id=${id}`, {isRedirect: true})
}
</script>

<template>
    <uni-nav-bar :title="title" :fixed="true" :color="color" :border="false" left-icon="left" :status-bar="true"
                 :status-bar-bg="statusBarBg" @click-left="() => onClickLeft()">
    </uni-nav-bar>
</template>

<style lang="scss" scoped>
:deep(.uniui-left) {
    font-size: 44rpx !important;
}
</style>
